<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/finance/fpAccountVoucher/list">进账凭条列表</a></li>
    <li class="active">{{id ? "编辑进账凭条" : "上传进账凭条"}}</li>
  </ol>
  <form class="form-horizontal" style="width: 80%;" role="form" name="form" ng-submit="save()" novalidate> 
    <div class="form-group" ng-class="{'has-error':form.accountVoucherUrl.$invalid }">
      <label class="col-sm-2 control-label">进账凭条</label>
      <div class="col-sm-5">
        <div class="input-group">
          <input type="text" readonly style="background-color: darkgray;" class="form-control" placeholder="进账凭条" name="accountVoucherUrl" ng-model="accountVoucher.accountVoucherUrl" required="required">
           <span class="input-group-addon add-pic-btn">上传凭条图片</span>
        </div>
       
      </div>
    </div>
    <div class="form-group" style="position: absolute; left: 60%; top: 100px;">
      <div style="font-size: 18px;font-weight: 600;">凭条预览</div> 
      <div class="col-sm-5">
        <img  ng-src="{{staticHost}}{{accountVoucher.accountVoucherUrl}}" style="width: 450px;" />
      </div>
    </div>
    <div class="form-group" ng-class="{'has-error':form.fundAccountName.$invalid}" >
      <label class="col-sm-2 control-label">打款账户名</label>
      <div class="col-sm-5">   
        <input type="text"  required="required" class="form-control" name="fundAccountName" placeholder="打款账户名" ng-change="showAllExistingAccount()" ng-model="accountVoucher.fundAccountName" autocomplete="off" >
        <div class="sanfang-company" style="width: 92%;" ng-show="isShowExistingAccount">
        <ul>
            <li ng-repeat="(key,value) in allExistingAccount" ng-click="isShowExistingAccountClick(value)">{{value}}</li>
          </ul>
          </div>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.allMoney.$invalid}">
      <label class="col-sm-2 control-label">进账总金额</label>
      <div class="col-sm-5">
        <input readonly type="text" class="form-control" placeholder="进账总金额" name="allMoney" ng-model="accountVoucher.allMoney"   >
        <span>总金额=选择产品进账金额总和，不可编辑</span>
      </div>
    </div>

    <div class="form-group" ng-class="{'has-error':form.companyAccountName.$invalid}">
      <label class="col-sm-2 control-label">公司入账账户名</label>
      <div class="col-sm-5">
         <select class="form-control" placeholder="公司入账账户名" name="companyAccountName"  required="required" ng-model="accountVoucher.companyAccountName"  >
            <option value="">--公司入账账户名--</option>
            <option value="SFA公户">SFA公户</option>
            <option value="杰熹公户">杰熹公户</option>
            <option value="SFA私户">SFA私户</option>
         </select>
      </div>
    </div>

    <div ng-repeat="item in productInfo" style="margin-top:30px;border-bottom:1px solid #ccc;">

        <div class="form-group" ng-class="{'has-error':form.productCode.$invalid}">
          <label class="col-sm-2 control-label">选择产品</label>
          <div class="col-sm-5">
         
             <input type="text"  style="float: left;width: 30%;" class="form-control" placeholder="产品简称" name="queryName" ng-model="item.queryName"  ng-change="showFullName($index,item.queryName)" >
                <select  style="float: left;width: 70%;" name="productCode" class="form-control"  ng-model="item.productCode" ng-options="m.p_code as m.p_name for m in item.productFullName" ng-change="item.queryName=''"  placeholder="产品简称" >
                <option value="">--选择产品简称--</option>
              </select>
          </div>
              <span style="margin-left:50px;width: 80px;    cursor: pointer;" type="button" ng-if="$index==0" ng-click="addItem()"  class="input-group-addon">  增加</span>
               <span type="button" style="margin-left:50px;width: 80px;    cursor: pointer;" ng-if="$index>0" ng-click="deleteItem($index)"  class="input-group-addon"> 
            删除
               </span>
        </div>
           <div class="form-group" >
          <label class="col-sm-2 control-label">入账类型</label>
          <div class="col-sm-5">
            <input type="checkbox" ng-true-value="0" ng-false-value="1" ng-model="item.sale">销售费用
              <input type="checkbox" ng-true-value="0" ng-false-value="1"  ng-model="item.tiexi">贴息
              <input type="checkbox" ng-true-value="0" ng-false-value="1"   ng-model="item.buxi">补息
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error':form.accountMoney.$invalid}">
          <label class="col-sm-2 control-label">进账金额</label>
          <div class="col-sm-5">
             <input type="text" class="form-control" placeholder="进账金额" name="accountMoney" ng-change="changeMoney()" ng-model="item.accountMoney" required="required" >
          </div>
        </div>
        
    </div>
   
    <div class="form-group" style="margin-top:30px;">
      <div class="col-sm-offset-2 col-sm-5">
        <button type="submit" class="btn btn-default">提交</button>
      </div>
    </div>
  </form>
</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>

